package com.yunshang.shoppingmall.service;

import com.yunshang.shoppingmall.entity.Order;
import com.yunshang.shoppingmall.entity.OrderToData;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

public interface OrderService {
    int deleteByPrimaryKey(Integer orderId);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Integer orderId);
    List<Order> selectOrderCheck(Date ptime);
    Order selectByNo(String orderNo);
    int updateByPrimaryKeySelective(Order record);
    List<Order> selectOrderActivityOne(String userId);
    int updateByPrimaryKey(Order record);
    List<Order> selectAll();
    List<Order> selectByUserId(String userId);
    List<Order> selectDate(Date t1,Date t2);
    int updateOrderStatus(@Param("orderStatus") String orderStatus,@Param("orderNo") String orderNo);
    int updateOrderStatus1(@Param("orderStatus") String orderStatus,@Param("orderList") List<String> orderList);
    List<Order> selectQuery(@Param("orderStatus") String orderStatus,
                            @Param("payStatus") String payStatus,
                            @Param("deliveStatus") String deliveStatus,
                            @Param("keywords") String keywords,
                            @Param("userNo") String userNo);

    //根据用户编号查询已经支付订单的订单
    List<Order> selectPayOrderByUserNoId(OrderToData orderToData);
    //首次消费
    Order selectFirstConsume(int userNoId);
    int upOrderFrom(@Param("nos") List<String> nos,@Param("exporttime") Date exporttime);
    int updateOrderAddressId(@Param("orderAddressId") String orderAddressId,@Param("orderNo") String orderNo);
    //按时间查询用户订单详细
    List<Order> selectOrderListByPayTime(OrderToData orderToData);

    Boolean successOrderPay(Map<String, Object> map);
    List<Order> selectListOrderCartByNo(String orderNo);

    void activity(Order order,String userNoId,double commission,Integer userReUserId);
    void activity(Order order,String userNoId,double commission,Integer userReUserId,double balance);
}
